<script>
    $(function () {
        $('#form_id').validationEngine();

        $("input[name*='Time']").datepicker({dateFormat:'yy-mm-dd'});

        $(".abandon").click(function () {
            var url = $(this).attr("name");
            location.replace(url);
        });
    });
</script>
<div style="float:left"><h3 id="comments-title"><em>商品采购信息</em></h3></div>
<a href="#" style="float:right;line-height:20px;padding:10px;" href="#" class="link_close"
   onclick=" $('#order_add').hide(); $('#bgDiv').hide(); return false;"></a>
</div>
<div class="clear"></div>
<div style="border: 1px solid #ddd;padding:0px 8px;">
    <div style="padding:10px 0;">
        <?php
        echo form_open("order/wait_for_buy_commodity_save/" . $commodity[0]['id'] . "/" . $num, array('id' => 'form_id'));
        ?>
        <?php
        foreach ($commodity as $k => $v):
            ?>                          
            <div style="margin: 10px 0px;">
                <label>采购途径:</label>
                <?php
                $data = array(
                    "type" => "text",
                    "name" => "procurement",
                    "id" => "procurement",
                    "value" => $v['procurement'],
                    "size" => "15",
                    "class" => "validate[required]",
                );
                echo form_input($data);
                ?> 
                <label>采购单号:</label>
                <?php
                $data = array(
                    "type" => "text",
                    "name" => "procureNumber",
                    'id' => 'procureNumber',
                    "value" => $v['procureNumber'],
                    "size" => "15",
                    "class" => "validate[required]"
                );
                echo form_input($data);
                ?>
            </div>       
            <div style="margin: 10px 0px;">
                <label>采购日期:</label>
                <?php
                $data = array(
                    "type" => "text",
                    "name" => "procureTime",
                    "id" => 'procureTime',
                    "value" => $v['procureTime'],
                    "size" => "15",
                    "class" => "validate[required,custom[date]]"
                );
                echo form_input($data);
                ?>
                <label>采购数量:</label>
                <?php
                $data = array(
                    "type" => "text",
                    "name" => "procureAmount",
                    'id' => 'procureAmount',
                    "value" => $v['procureAmount'],
                    "size" => "15",
                    "class" => "validate[required,custom[integer]]"
                );
                echo form_input($data);?>
                
            </div>
            <div style="margin: 10px 0px;">
                <label>采购价格:</label>
                <?php
                $data = array(
                    "type" => "text",
                    "name" => "procureUnitPrice",
                    'id' => 'procureUnitPrice',
                    "value" => $v['procureUnitPrice'],
                    "size" => "15",
                    "class" => "validate[required,custom[number]]"
                );
                echo form_input($data);
                
                ?>
                <label>采购运费:</label>
                <?php
                $data = array(
                    "type" => "text",
                    "name" => "procureFreight",
                    'id' => 'procureFreight',
                    "value" => $v['procureFreight'],
                    "size" => "10",
                    "class" => "validate[required,custom[number]]"
                );
                echo form_input($data);
                ?>
            </div>
            <div style="margin: 10px 0px;">
                <label>采购总额:</label>
                <?php
                $data = array(
                    "type" => "text",
                    "name" => "procureMoney",
                    'id' => 'procureMoney',
                    "value" => $v['procureMoney'],
                    "size" => "10",
                    "class" => "validate[required,custom[number]]"
                );
                echo form_input($data);
                ?>
            </div>
        <?php endforeach; ?>
        <center style="padding-bottom:10px;">
            <?php
            $data = array('name' => 'my_submit', 'value' => '保存', 'class' => 'save confirm', 'id' => 'submit_confirm');
            echo form_submit($data);
            ?>
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            <?php
            $data = array('type' => 'button', 'class' => 'abandon confirm', 'value' => '撤销', 'name' => site_url("order/wait_for_buy_commodity_abandon/" . $commodity[0]['id'] . "/" . $num));
            echo form_input($data);
            ?>
        </center>
        <?php
        echo form_close();
        ?>
    </div>
</div>
<div class="clear"></div>
